<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition     xmlns="http://www.w3.org/1999/xhtml"
                    xmlns:ui="http://java.sun.com/jsf/facelets"
                    xmlns:h="http://java.sun.com/jsf/html"
                    xmlns:ice="http://www.icesoft.com/icefaces/component"
                    xmlns:f="http://java.sun.com/jsf/core"
                    xmlns:odr="http://java.sun.com/jsf/composite/odr">

    <ice:form id="manageDecisionSidebarForm"
              partialSubmit="true"
              rendered="#{manageDecisionController.valid}"
              styleClass="templateRelatedSidebar">

        <h1><ice:outputText value="#{form['decision.wizard.template.headline']}" nospan="true" /></h1>


        <div class="formSection">
            <ice:outputLabel value="#{form['decision.wizard.template.external.search']}" for="inExternal"/>
            <ice:inputText id="inExternal"
                           value="#{manageDecisionController.templateRelatedStep.externalIdInput}"
                           label="#{form['decision.wizard.template.external.search']}"/>

            <ice:commandButton action="#{manageDecisionController.templateRelatedStep.queryWebservice}"
                               value="#{form['button.search']}"
                               styleClass="add"
                               partialSubmit="true"
                               immediate="true"
                               id="manageDecisionSearchExternalId"
                               onclick="odr.decisionWizardSearchOne(true);"/>

            <ice:outputText value="#{form['decision.wizard.template.external.search.error']}"
                            rendered="#{manageDecisionController.templateRelatedStep.searchError}"
                            styleClass="searchError"/>

            <ice:outputText value="#{form['decision.wizard.template.external.search.no.result']}"
                            rendered="#{manageDecisionController.templateRelatedStep.noResult}"
                            styleClass="searchError"/>

            <img id="ajaxLoaderBar" src="resources/images/ajax-loader-bar.gif" width="220"
                 height="19" alt="Ajax loading bar" class="ajaxLoader"/>

            <p class="empty increasedPadding" style="clear: right;"/>
        </div>



        


        <div class="formSection">
            <ice:outputLabel value="#{form['decision.wizard.template.external.name']}" for="inSelectExternal"/>


            <ice:selectOneMenu value="#{manageDecisionController.templateRelatedStep.selectedExternalId}"
                               label="#{form['decision.wizard.template.external.name']}"
                               id="inSelectExternal"
                               styleClass="initDisabled">
                <f:selectItem itemLabel="#{form['label.pleaseSelect']}" noSelectionOption="true"/>
                <f:selectItems value="#{manageDecisionController.templateRelatedStep.externalPossibilities}" />
            </ice:selectOneMenu>

            <ice:commandButton action="#{manageDecisionController.templateRelatedStep.selectExternalId}"
                               value="#{form['button.retrieve']}"
                               styleClass="add initDisabled"
                               partialSubmit="true"
                               immediate="true"
                               id="manageDecisionSelectExternalId"/>

            <ice:outputText value="#{form['decision.wizard.template.external.retrieve.error']}"
                            rendered="#{manageDecisionController.templateRelatedStep.error}"
                            styleClass="retrieveError"/>

            <p class="empty increasedPadding" style="clear: right; padding: 0 0 43px;"/>
        </div>











        <ice:outputText value="#{form['decision.wizard.template.na']}"
                        rendered="#{empty manageDecisionController.templateRelatedStep.genericInformation}"
                        style="position: relative; top: 10px;"/>

        <ice:panelGroup rendered="#{!empty manageDecisionController.templateRelatedStep.genericInformation}">
            <h1>
                <ice:outputText value="#{manageDecisionController.templateRelatedStep.genericInformation.name}"
                                nospan="true" />
            </h1>

            <ice:repeat value="#{manageDecisionController.templateRelatedStep.genericInformation.documentation}" var="item">
                <h2><ice:outputText value="#{item.name}" nospan="true" /></h2>
                <ice:outputText value="#{manageDecisionController.templateRelatedStep.toOprWiki(item.content)}" nospan="true" escape="false"/>
            </ice:repeat>
        </ice:panelGroup>

    </ice:form>

</ui:composition>
